package com.iwop.moto.service.impl;

import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.SignService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuwb 2016-07-20 08:55
 */
@Service
public class SignServiceImpl extends BaseService implements SignService {

    /**
     * 功能:新增 - 签到
     */
    public void insertSign (SuperRecordModel SRModel) {
        getSqlSession().insert("FSignMapper.insertSign",SRModel);
    }

    /**
     * 功能:列表 - 签到（按月/按userId）
     */
    public List<SuperRecordModel> findSignList(SuperRecordModel SRModel){
        return getSqlSession().selectList("FSignMapper.findAllSign",SRModel);
    }

    public Long findSingNowCount(SuperRecordModel SRModel){
        return (Long)getSqlSession().selectOne("FSignMapper.findSingNowCount", SRModel);
    }

    @Override
    public SuperRecordModel getLastSign(SuperRecordModel srModel) {
        return getSqlSession().selectOne("FSignMapper.getLastSign",srModel);
    }
}
